package edu.gdkm.ssm.dao;

import edu.gdkm.ssm.domain.Traveller;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 旅客信息查询仓储
 */
public interface ITravellerDao {

    /**
     * 根据orderId查询外表得到旅客的id
     * 再根据旅客的id查询旅客信息
     * @param ordersId 订单id
     * @return
     * @throws Exception
     */
    @Select("select * from traveller where id in (select travellerId from order_traveller where orderId=#{ordersId})")
    List<Traveller> findByOrdersId(String ordersId) throws Exception;
}
